<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>DomTree</title>
    <script>
        function getInput() {
            var elementsByName = document.getElementsByName('111');
            alert(elementsByName[0].value)
        }

        function addLine() {
            var inputStr = document.getElementById('addstr');
            var byIdUl = document.getElementById('ul1');
            var elementLi = document.createElement('li');
            var textLi = document.createTextNode(inputStr.value);
            elementLi.appendChild(textLi);
            byIdUl.appendChild(elementLi);
            inputStr.value="";
            alert("success!")
        }
    </script>
</head>
<body>
<input type="text" name="111">
<input type="submit" onclick="getInput()" value="getValue">

<hr>

<ul id="ul1">
    <li>zs</li>
    <li>sd</li>
    <li>de</li>
    <li>mm</li>
</ul>
<input type="text" id="addstr">
<input type="submit" value="addLi" onclick="addLine()">
</body>
</html>